using System;
using System.Collections;
using System.Collections.Specialized;

namespace SharpMud.Scripting
{
	public class ScriptExecutionContext : System.Collections.IDictionary
	{
		private System.Collections.Specialized.HybridDictionary _dictionary;

		private ScriptExecutionContext()
		{
			_dictionary = new HybridDictionary();
		}

		#region IDictionary Members

		public bool IsReadOnly
		{
			get
			{
				return _dictionary.IsReadOnly;
			}
		}

		public System.Collections.IDictionaryEnumerator GetEnumerator()
		{
			return _dictionary.GetEnumerator();
		}

		object IDictionary.this[object key]
		{
			get
			{
				return this[(string)key];		
			}
			set
			{
				this[(string)key] = value;
			}
		}

		public object this[string contextItemName]
		{
			get
			{
				return _dictionary[(object)contextItemName];
			}
			set
			{
				_dictionary[(object)contextItemName] = value;
			}
		}

		void IDictionary.Remove(object key)
		{
			Remove((string)key);
		}

		public void Remove(string contextItemName)
		{
			_dictionary.Remove((object)contextItemName);
		}

		bool IDictionary.Contains(object key)
		{
			return Contains((string)key);
		}

		public bool Contains(string contextItemName)
		{
			return _dictionary.Contains((object)contextItemName);
		}

		public void Clear()
		{
			_dictionary.Clear();
		}

		public System.Collections.ICollection Values
		{
			get
			{
				return _dictionary.Values;
			}
		}

		void IDictionary.Add(object key, object value)
		{
			Add((string)key,value);
		}

		public void Add(string contextItemName, object value)
		{
			_dictionary.Add((object)contextItemName,value);
		}

		public System.Collections.ICollection Keys
		{
			get
			{
				return _dictionary.Keys;;
			}
		}

		public bool IsFixedSize
		{
			get
			{
				return _dictionary.IsFixedSize;
			}
		}

		#endregion

		#region ICollection Members

		public bool IsSynchronized
		{
			get
			{
				return _dictionary.IsSynchronized;
			}
		}

		public int Count
		{
			get
			{
				return _dictionary.Count;
			}
		}

		public void CopyTo(Array array, int index)
		{
			_dictionary.CopyTo(array,index);
		}

		public object SyncRoot
		{
			get
			{
				return _dictionary.SyncRoot;
			}
		}

		#endregion

		#region IEnumerable Members

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return _dictionary.GetEnumerator();;
		}

		#endregion

		#region Public Methods
		public void ValidateSelf()
		{
			throw new NotImplementedException();
		}

		public bool IsValid(ScriptExecutionParameters scriptExecParams)
		{
			throw new NotImplementedException();
		}
		#endregion
	}
}
